package cn.school.ctrl;

import cn.school.entity.Grade;
import cn.school.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GradeController {
    @Autowired
    private GradeService gradeService;

    //@GetMapping(value = "findGrades",produces = {"application/json;charset=utf-8"})
    //@ResponseBody
    @GetMapping("findGrades")
    public List<Grade> findall(){
        return gradeService.findALL();
    }
}
